add --unstaged option to view only unstaged files/hunks#521
add --unstaged option to view only unstaged files/hunks#521githendrik wants to merge 1 commit intobacknotprop:mainfrom
Conversation
| } else { | ||
| // --- Local Review Mode --- | ||
| gitContext = await getVcsContext(); | ||
| initialDiffType = gitContext.vcsType === "p4" ? "p4-default" : "uncommitted"; |
There was a problem hiding this comment.
We have P4 users. I need to make sure this doesn't break for them.
There was a problem hiding this comment.
Oh, okay. I wasn't aware of this case. Do you need me to change something? Just let me know.
There was a problem hiding this comment.
caveat, i havent fully reviewed...
deleted: gitContext.vcsType === "p4" ? "p4-default"
You might still need a ternary path to make this assignment is my concern.
I can validate later today and trace myself, and if I see a fix, I'll fix it. Otherwise, I think you just need to have a bit more verbose ternary that includes your new option but also the P4 default if that's set as vcsType.
|
Hey Hendrik, thanks for this PR! Your workflow of staging approved hunks and reviewing only what's left is a great pattern. I ended up going a slightly different direction with this. Instead of a CLI flag, I made the default diff type a persistent user setting (configurable in Settings > Display, stored in config.json). I also added a first-run dialog that prompts users to pick their preferred default the first time they open a local review. And I changed the hardcoded default from "uncommitted" to "unstaged" to match You have co-authorship on the commit in #531 since your PR is what kicked this off. Appreciate you taking the time to contribute. |
feat(review): configurable default diff type with first-run setup Add `defaultDiffType` as a persistent user setting (cookie + config.json) with 'unstaged' as the default, matching `git diff` semantics. A first-run setup dialog prompts users to choose their preferred default on first review session. The setting is also available in Settings > Display. Entry points (hook, opencode, pi-extension) read the config via `resolveDefaultDiffType()` instead of hardcoding. The setup dialog applies the chosen diff type to the active review immediately. P4 users are excluded from the Git-specific dialog. Based on the community contribution in #521 by Hendrik Richert. Co-authored-by: Hendrik Richert <hendrik.richert@swisscom.com>
Related to this issue: #287
My personal flow is to stage hunks that I approved in previous steps. This flag allows me to view only the most recent changes.